home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / manipMoveValues.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  5.0 KB  |  161 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17.  
  18. global proc manipMoveValues ( string $toolName ) {
  19.  
  20.     string $parent = (`toolPropertyWindow -q -location` + "|manipMove");
  21.     setParent $parent;
  22.  
  23.     // Initialize settings
  24.     //
  25.     int $manipMode = `manipMoveContext -q -mode $toolName`;
  26.     switch ($manipMode)
  27.     {
  28.         case 0:
  29.             radioButtonGrp -e -sl 1 manipModeRadio1;
  30.             $manipMode = 1;
  31.         break;
  32.  
  33.         case 1:
  34.             radioButtonGrp -e -sl 2  manipModeRadio1;
  35.             $manipMode = 2;
  36.         break;
  37.  
  38.         case 2:
  39.             radioButtonGrp -e -sl 1 manipModeRadio2;
  40.             $manipMode = 3;
  41.         break;
  42.  
  43.         case 3 :
  44.             radioButtonGrp -e -sl 2 manipModeRadio2;
  45.             $manipMode = 4 ;
  46.         break;
  47.  
  48.         case 4 :
  49.             radioButtonGrp -e -sl 1 manipModeRadio3;
  50.             $manipMode = 5 ;
  51.     }
  52.  
  53.     // Object vs Local vs Global Space vs vertex Normal
  54.     //
  55.     radioButtonGrp -e
  56.         -nrb 2
  57.         -on1 ("manipMoveContext -e -mode 0 " + $toolName)
  58.         -on2 ("manipMoveContext -e -mode 1 " + $toolName)
  59.         manipModeRadio1 ;
  60.  
  61.     radioButtonGrp -e
  62.         -nrb 2
  63.         -on1 ("manipMoveContext -e -mode 2 " + $toolName)
  64.         -on2 ("manipMoveContext -e -mode 3 " + $toolName)
  65.         manipModeRadio2;
  66.  
  67.     radioButtonGrp -e
  68.         -nrb 1
  69.         -on1 ("manipMoveContext -e -mode 4 " + $toolName)
  70.         manipModeRadio3;
  71.  
  72.     int    $isSnapCompRelative = `manipMoveContext -q -snapComponentsRelative $toolName`;
  73.  
  74.     int    $isSnap  = `manipMoveContext -q -snap $toolName`;
  75.     int    $isRelative = `manipMoveContext -q -snapRelative $toolName`;
  76.     float  $snapVal = `manipMoveContext -q -snapValue $toolName`;
  77.     int    $isSnapFaceCenter = `manipMoveContext -q -snapLiveFaceCenter $toolName`;
  78.     int    $isSnapVertex = `manipMoveContext -q -snapLivePoint $toolName`;
  79.     
  80.     checkBoxGrp -e -v1 $isSnapCompRelative manipSnapCompRelative;
  81.  
  82.     checkBoxGrp -e -v1 $isSnap manipMoveSnapCheck;
  83.     checkBoxGrp -e -enable $isSnap -v1 $isRelative manipMoveSnapRelative;
  84.     floatFieldGrp -e -enable $isSnap -v1 $snapVal manipMoveSnapValue;
  85.     checkBoxGrp -e -v1 $isSnapFaceCenter manipSnapFaceVertex;
  86.     checkBoxGrp -e -v2 $isSnapVertex manipSnapFaceVertex;
  87.     
  88.     checkBoxGrp -e 
  89.         -cc1 ("manipMoveContext -e -snapComponentsRelative #1 " + $toolName)
  90.         manipSnapCompRelative;
  91.  
  92.     checkBoxGrp -e 
  93.         -cc1 ("manipMoveContext -e -snap #1 " + $toolName)
  94.         manipMoveSnapCheck;
  95.  
  96.     checkBoxGrp -e 
  97.         -cc1 ("manipMoveContext -e -snapRelative #1 " + $toolName)
  98.         manipMoveSnapRelative;
  99.  
  100.     floatFieldGrp -e 
  101.         -cc ("manipMoveContext -e -snapValue #1" + " " + $toolName )
  102.         manipMoveSnapValue;
  103.  
  104.     checkBoxGrp -e 
  105.         -cc1 ("manipMoveContext -e -snapLiveFaceCenter #1 " + $toolName)
  106.         manipSnapFaceVertex;
  107.  
  108.     checkBoxGrp -e 
  109.         -cc2 ("manipMoveContext -e -snapLivePoint #1 " + $toolName)
  110.         manipSnapFaceVertex;
  111.  
  112.     if ( (`radioButtonGrp -q -sl manipModeRadio1`) || 
  113.          (`radioButtonGrp -q -sl manipModeRadio3`) ) {
  114.         // If object/local mode ... (or along rotation axes mode)
  115.  
  116.         if (`checkBoxGrp -q -value1 manipMoveSnapCheck`) {
  117.             // If Discrete Move ...
  118.  
  119.             // It has to be Discrete Relative.  Force it ON and Disable It.
  120.             // 
  121.             checkBoxGrp -e -value1 true manipMoveSnapRelative;
  122.             checkBoxGrp -e -enable false manipMoveSnapRelative;
  123.             manipMoveContext -e -snapRelative on $toolName;
  124.         }
  125.     } else {
  126.         // For other modes...
  127.         if (`checkBoxGrp -q -value1 manipMoveSnapCheck`) {
  128.             checkBoxGrp -e -enable true manipMoveSnapRelative;
  129.         }
  130.     }
  131.  
  132.     // set the state for the interactiveUpdate flag.
  133.     // valid only if mode is "vertex normal".
  134.     //
  135.     int $interactiveUpdate = `manipMoveContext -q -interactiveUpdate $toolName`;
  136.     checkBoxGrp -e  -onc ("manipMoveContext -e -iu 1 " + $toolName)
  137.           -ofc ("manipMoveContext -e -iu 0 " + $toolName) 
  138.           -v1 $interactiveUpdate UVNtriadUpdateCheckBox;
  139.  
  140.     // make the UVNtriadUpdateCheckBox visible or not ?    
  141.     // visible if manipMode is vertexNormal i.e. 4
  142.     //
  143.     if( $manipMode == 4 ) {
  144.         checkBoxGrp -e -vis 1 UVNtriadUpdateCheckBox ;
  145.     } else {
  146.         checkBoxGrp -e -vis 0 UVNtriadUpdateCheckBox ;
  147.     }
  148.  
  149.     string $icon;
  150.     string $helpTag;
  151.     if( $manipMode != 4 ) {
  152.         $icon = "manipMove.xpm";
  153.         $helpTag = "MoveTool";
  154.     } else {
  155.         $icon = "moveNormal.xpm";
  156.         $helpTag = "MoveNormalTool";
  157.     }
  158.     toolPropertySetCommon $toolName $icon $helpTag;
  159.     toolPropertySelect "manipMove";
  160. }
  161.